//
//  LoadingViewTest.m
//  Reservation
//
//  Created by Wai Man Chan on 5/3/14.
//  Copyright (c) 2014 CHAN, Wai Man. All rights reserved.
//

#import <XCTest/XCTest.h>
#import "LoadingViewController.h"

@interface LoadingViewTest : XCTestCase {
    LoadingViewController *vc;
}
@end

@implementation LoadingViewTest

- (void)setUp
{
    [super setUp];
    // Put setup code here. This method is called before the invocation of each test method in the class.
    vc = [LoadingViewController shareController];
}

- (void)tearDown
{
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}

- (void)testStartLoading {
    [vc startLoading];
    XCTAssertTrue(vc.loading, @"Not loaded");
}

- (void)testStopLoading {
    [vc startLoading];
    [vc stopLoading];
    XCTAssertFalse(vc.loading, @"Loaded");
}

- (void)testDoubleStartLoading {
    [vc startLoading];
    [vc startLoading];
    XCTAssertTrue(vc.loading, @"Not loaded");
}

- (void)testDoubleStopLoading {
    [vc stopLoading];
    [vc stopLoading];
    XCTAssertFalse(vc.loading, @"Loaded");
}

@end
